import { IFeidaoAiMobile } from '@dfeidao/atom-mobile/interfaces';
import get from '@dfeidao/atom-mobile/local/get';
import set from '@dfeidao/atom-mobile/local/set';
import show_sheet from '@dfeidao/atom-mobile/msgbox/action-sheet';
import render from '@dfeidao/atom-mobile/render/render';
export default async function a003(fd: IFeidaoAiMobile) {
	const subject = get(fd, 'subject') as [{ subject_num: string, subject_name: string }];
	const options = new Array();
	subject.forEach((i) => {
		options.push({ text: i.subject_name });
	});
	const res = await show_sheet({
		options,
		title: '科目'
	});
	const class_s = subject[res] as { subject_num: string, subject_name: string };
	if (!class_s) {
		return;
	}
	render(fd, { subject: class_s.subject_name });
	set(fd, 'subject1', class_s);
}
